package com.zp.drug.service;

import com.zp.common.myBatis.core.page.PageQuery;
import com.zp.common.myBatis.core.page.TableDataInfo;
import com.zp.drug.entity.bo.GrantStockVsPrescriptionBo;
import com.zp.drug.entity.vo.GrantStockVsPrescriptionVo;

import java.util.Collection;
import java.util.List;

/**
 * 保存库存扣减、stock_log和处方对应Service接口
 *
 * @author zhang peng
 * @ date 2024-06-07
 */
public interface IGrantStockVsPrescriptionService {

    /**
     * 查询保存库存扣减、stock_log和处方对应
     */
    GrantStockVsPrescriptionVo queryById(String grantStockVsId);

    /**
     * 查询保存库存扣减、stock_log和处方对应列表(分页)
     */
    TableDataInfo<GrantStockVsPrescriptionVo> queryPageList(GrantStockVsPrescriptionBo bo, PageQuery pageQuery);

    /**
     * 查询保存库存扣减、stock_log和处方对应列表(不分页)
     */
    List<GrantStockVsPrescriptionVo> queryList(GrantStockVsPrescriptionBo bo);

    /**
     * 修改保存库存扣减、stock_log和处方对应
     */
    Boolean insertByBo(GrantStockVsPrescriptionBo bo);

    /**
     * 修改保存库存扣减、stock_log和处方对应
     */
    Boolean updateByBo(GrantStockVsPrescriptionBo bo);

    /**
     * 校验并批量删除保存库存扣减、stock_log和处方对应信息
     */
    Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);

    /**
     * 组织并保存数据
     *
     * @param stockId
     * @param identicalInfoId
     * @param num
     * @param prescriptionApplyId
     * @param prescriptionItemId
     * @param batchNo
     * @return
     */
    Boolean tissueAndSaveInfo(String stockId, String identicalInfoId, Integer num,
                              String prescriptionApplyId, String prescriptionItemId,
                              String batchNo, String drugStockAllLogId);
}
